package com.yqya.springboot.shiro.practice.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页
 *
 * @author Kevin
 * @date 2019-07-28
 */
@RestController
public class IndexController {

    @GetMapping(value = "/index")
    public String index() {
        return "首页";
    }

    @GetMapping(value = "/error")
    public String error() {
        return "错误页面";
    }

    @RequiresRoles("admin")
    @RequiresPermissions("100100")
    @GetMapping(value = "/create")
    public String create() {
        return "创建成功";
    }

}
